﻿
namespace BaddiesEditor
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    /// <summary>
    /// Class that displays an error form.
    /// </summary>
    public partial class ErrorForm : Form
    {
        /// <summary>
        /// Initializes a new instance of the ErrorForm class.
        /// </summary>
        public ErrorForm()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Handler for the load of the ErrorForm.
        /// </summary>
        /// <param name="sender">Class that sends the msg.</param>
        /// <param name="e">Message arguments.</param>
        private void ErrorForm_Load(object sender, EventArgs e)
        {
            this.errorMsg.MaximumSize = new Size(this.Width - (2 * this.errorMsg.Location.X), 0);
        }

        /// <summary>
        /// Handler for the ok button.
        /// </summary>
        /// <param name="sender">Class that sends the msg.</param>
        /// <param name="e">Message arguments.</param>
        private void OkButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        /// <summary>
        /// Sets the error message of the ErrorForm.
        /// </summary>
        /// <param name="msg">MEssage to show.</param>
        public void SetErrorMsg(string msg)
        {
            this.errorMsg.Text = msg;
        }        
    }
}
